-
Notifications
You must be signed in to change notification settings - Fork 661
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update copy.h #633
base: master
Are you sure you want to change the base?
Update copy.h #633
Conversation
check available destination space before copy
include/chia/copy.h
Outdated
@@ -17,10 +17,17 @@ | |||
#include <cstdio> | |||
#include <cstdint> | |||
|
|||
#include <filesystem> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that has created many problems before, gotta souround all of it with #ifdef __linux__
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks, no real programming experience so forgive my terrible coding...
include/chia/copy.h
Outdated
|
||
inline | ||
uint64_t copy_file(const std::string& src_path, const std::string& dst_path) | ||
{ | ||
#ifdef __linux__ | ||
int plotsize = 109000000000 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are you sure that number fits into an int
lol
you need uint64_t
here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
make it const uint64_t
too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes I was wondering about that! I guess it would be better to get the real size value but just put a rough value for now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's not a constant anyways, all good
add room for alternate destination directory
check available destination space before copy